package com.alibaba.nacos.naming.core.v2.event.metadata;

import com.alibaba.nacos.common.notify.Event;
import com.alibaba.nacos.naming.core.v2.ServiceManager;
import com.alibaba.nacos.naming.core.v2.pojo.Service;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public class MetadataEvent extends Event {

    private final Service service;
    private final boolean expired;


    public static class ServiceMetadataEvent
            extends MetadataEvent {

        public ServiceMetadataEvent(Service service, boolean expired) {
            super(service, expired);
        }
    }

    public static class InstanceMetadataEvent
            extends MetadataEvent {

        private final String metadataId;

        public InstanceMetadataEvent(Service service, String metadataId, boolean expired) {
            super(service, expired);
            this.metadataId = metadataId;
        }
    }


}
